package com.czkevin.biliwsclient.lottery;

import java.util.Map;

public class JoinCondition {

  public static final JoinCondition DANMU_ONLY = new JoinCondition();


  public final JoinType type;

  public final int giftId;

  public final int giftNum;

  public JoinCondition() {
    this.type = JoinType.DANMU;
    giftId = -1;
    giftNum = -1;
  }

  public JoinCondition(int giftId, int giftNum) {
    this.type = JoinType.GIFT;
    this.giftId = giftId;
    this.giftNum = giftNum;
  }

  public void putParams(Map<String, String> params) {
    params.put("join_type", Integer.toString(type.networkType));
    if(type == JoinType.GIFT) {
      params.put("gift_id", Integer.toString(giftId));
      params.put("gift_num", Integer.toString(giftNum));
    } else {
      params.put("gift_id", "");
      params.put("gift_num", "1");
    }
  }
}
